package com.mhc.suzuki.manager.impl;

import com.mhc.suzuki.dal.mapper.ext.MobileAreaExtMapper;
import com.mhc.suzuki.dal.model.MobileAreaDO;
import com.mhc.suzuki.dal.query.MobileAreaQuery;
import com.mhc.suzuki.manager.MobileAreaManager;
import com.subaru.common.query.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for MobileArea.
 */

@Component
public class MobileAreaManagerImpl implements MobileAreaManager{

    
    @Autowired
    protected MobileAreaExtMapper mobileAreaExtMapper;
    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(MobileAreaQuery query){
        return mobileAreaExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(MobileAreaQuery query){
        return mobileAreaExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(MobileAreaDO record){
        return mobileAreaExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(MobileAreaDO record){
        return mobileAreaExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<MobileAreaDO> selectByQuery(MobileAreaQuery query){
        return mobileAreaExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
    */
    @Override
    public PageResult<MobileAreaDO> selectByQueryWithPage(MobileAreaQuery query) {
        PageResult<MobileAreaDO> result = new PageResult<MobileAreaDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public MobileAreaDO selectByPrimaryKey(Long id){
        return mobileAreaExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective( MobileAreaDO record,  MobileAreaQuery query){
        return mobileAreaExtMapper.updateByQuerySelective(record,  query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery( MobileAreaDO record,  MobileAreaQuery query){

        return mobileAreaExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(MobileAreaDO record){
        return mobileAreaExtMapper.updateByPrimaryKeySelective(record);
    }
}